package com.kehongborui.spring;

import com.kehongborui.empmanagesys.dao.EmpDao;
import com.kehongborui.empmanagesys.entity.ClassBean02;
import com.kehongborui.empmanagesys.entity.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.GregorianCalendar;

/**
 * @author zhang peng yang ming
 * @create 2018-07-26 22:33
 */
public class Spring {
    public static void main(String[] args) {
        // 实例化spring 容器
        ClassPathXmlApplicationContext context =                 // 加载工程classpath下的配置文件
                new ClassPathXmlApplicationContext("applicationContext.xml");

        //                                         调用getBean("标识符")方法
        LoginService loginService = context.getBean("loginService", LoginService.class);
        User 张彭洋明 = loginService.login("zhangpengyangming", "123456");
        System.out.println(张彭洋明);
        context.close();
    }
}
